The present invention relates to systems and methods for scoping operating system semantics in a computing environment which supports multi-enclave processes (that is, processes having multiple enclaves).
An operating system interface standard is a specification that defines the interface between operating systems which conform to the standard and application programs which are written to comply with the standard. Operating system interface standards are advantageous for a number of reasons, including enhanced portability. For example, applications which conform to an operating system interface standard are theoretically portable at the source code level to all computer systems having operating systems which conform to the standard. The portable operating system interface (POSIX) standard is an example of an operating system interface standard.
A computer programming language standard is a specification which defines the syntax and operation of a computer programming language. Various computer programming language standards exist, such as the ANSI and ISO standards for the C, COBOL, Fortran, and PL/I computer programming languages.
Operating system interface standards and computer programming language standards typically specify semantic scoping rules which define the breath (or scope) of semantics, such as variable and function declarations and name resolutions. Semantic scoping rules are discussed in many publicly available documents, such as Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman, Compilers: Principles,
Techniques, and Tools, Addison-Wesley Publishing Company, 1988, which is herein incorporated by reference in its entirety.
As used herein, the term xe2x80x9csemanticxe2x80x9d refers to an action which is taken as a result of executing a command or instruction contained, for example, in a computer program or a library routine. Distinction is made herein between xe2x80x9clanguage semanticsxe2x80x9d, which are semantics defined by computer programming language standards, and xe2x80x9coperating system semanticsxe2x80x9d, which are semantics defined by operating system interface standards.
Some operating system interface standards, such as the Portable Operating System Interface (POSIX) standard (discussed below), supports the following program execution constructs: processes and threads. A process is defined as including an address space, one or more threads that execute within that address space, and the system resources required by the threads. An application program includes one or more processes. A thread is defined as being a single flow of control within a process. Each thread has its own required resources to support its flow of control.
An xe2x80x9cenclavexe2x80x9d is another program execution construct, and represents an extension of a computer programming language standard. Enclaves are generally well known. An enclave comprises one or more threads. A process comprises one or more enclaves. Other names for enclaves exist. For example, in COBOL this program execution construct is called a xe2x80x9crun unitxe2x80x9d.
Where multi-enclave processes are permitted, enclaves define the scope of language semantics within processes. In other words, language semantics are scoped to the enclaves in which they respectively occur. For example, an enclave defines the scope of the language name resolutions in a process, such as those for Fortran COMMON or COBOL external program constructs or the scope of a main routine and the associated language semantics such as those of a xe2x80x9cSTOPxe2x80x9d statement.
The scoping specifications typically defined by operating system interface standards do not specify the behavior of application programs in environments which allow a process to contain multiple enclaves, particularly with regard to the scoping of operating system semantics. Consequently, the run-time behavior of such application programs is unpredictable. This problem is further described with reference to FIG. 1, which is a high-level block diagram of a conventional computer system 102.
The computer system 102 includes hardware components 104 such as one or more central processing units (CPU) 106, a random access memory (RAM) 108, and an input/output (I/O) interface 110. The computer system 102 also includes an operating system 120. Various peripheral devices are connected to the computer system 102, such as secondary storage devices 112 (such as a hard drive), input devices 114 (such as a keyboard and/or a mouse), display devices 116 (such as a monitor), and output devices (such as printers) 118.
A plurality of application programs 122, 124, 126 execute in the computer system 102. The application programs 122, 124, 126 may execute sequentially in the computer system 102, but preferably execute in parallel in the computer system 102.
Assume that enclaves (and processes having multiple enclaves) are permitted in the computer system 102, and that the operating system 120 conforms to an operating system interface standard that does not define the behavior of multi-enclave processes. Thus, the scoping of operating system semantics are undefined in the computer system 102. Specifically, an ambiguity exists as to whether operating system semantics are scored to the process or to the enclaves contained in the process. As a result of this ambiguity, the run-time behavior of application programs 122, 124, 126 is unpredictable.
Thus, what is required is a method and system for defining the behavior of computer programs pertaining to the scoping of operating system semantics where the computer programs execute in an extended environment which allows a process to contain multiple enclaves.
The present invention is directed to a system and method of scoping operating system semantics in a computing environment, wherein a process comprising at least one enclave is executing in the computing environment. The present invention operates by determining whether an operating system semantic is explicitly directed to the process. If the operating system semantic is explicitly directed to the process, then the operating system semantic is scoped to the process.
The present invention also determines whether the operating system semantic is implicitly directed to the process. If the operating system semantic is implicitly directed to the process, then the operating system semantic is scoped to an enclave of the process in which the operating system semantic occurs.